import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default function createRouter() {
  return new Router({
    mode: 'history',
    routes: [
      {
        path: '/',
        redirect: '/home'
      },
      {
        name: 'Home',
        path: '/home',
        component: () => import('@/pages/Home.vue')
      },
      {
        name: 'Test',
        path: '/test',
        component: () => import('@/pages/Test.vue')
      },
      {
        name: 'NotFound',
        path: '/404',
        component: () => import('@/pages/404.vue')
      },
      {
        path: '*',
        redirect: '/404'
      }
    ]
  })
}
